def getRes(weights, w):
    ...


def priority_sort(weights):
    priority = [weight[1] / weight[0] for weight in weights]
    priority_key = []
    sorted_pri = sorted(priority)
    min_value = min(priority)
    priority_key.append(priority.index(min_value))
    priority.remove(min_value)


if __name__ == "__main__":
    x = input()
    n, w = list(map(int, x.split(" ")))
    weights = []
    for _ in range(n):
        x = input()
        weight = list(map(int, x.split(" ")))
        weights.append(weight)
    print(weights)
    priority_sort(weights)
